package com.jsonal.blog;

import io.swagger.models.auth.In;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @Author: jsonal
 * @Description:
 * @Date: 2020/12/27 13:04
 * @Version: 1.0
 */
public class aa {

    public static void main(String[] args) {
       List<String> list = new ArrayList<String>() ;

       list.add("aa");
       list.add("bb");
       list.add("cc");
       list.add("dd");
       list.add("ee");

       List<String> list1 = new ArrayList<>();

       list1.add("a");
       list1.add("b");
       list1.add("aa");
       list1.add("ee");
       list1.add("c");

        List<String> collect = Stream.of(list, list1)
            .flatMap(Collection::stream)
            .distinct()
            .collect(Collectors.toList());

        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>整合后删除前>>>>>>>>>>>>>>>>>>>>>>>>");
        collect.forEach(item -> {
            System.out.println(item);

        });

        collect.removeAll(list);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>整合后删除后>>>>>>>>>>>>>>>>>>>>>>>>");
        collect.forEach(item -> {
            System.out.println(item);
        });
    }
}
